from datetime import datetime
from typing import Optional

from pydantic import BaseModel, UUID4


class BaseOutSchema(BaseModel):
    id: UUID4
    active: bool
    created_at: datetime
    updated_at: datetime

    class Config:
        from_attributes = True


class BaseEditSchema(BaseModel):
    active: Optional[bool] = True
    created_at: Optional[datetime] = None
    updated_at: Optional[datetime] = None


class BaseSelectOptionSchema(BaseModel):
    label: str
    value: str | UUID4
    active: bool

    class Config:
        from_attributes = True


class BaseFilterSchema(BaseModel):
    active: Optional[bool] = None
    created_between: Optional[list[str]] = None
    updated_between: Optional[list[str]] = None
